<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>定期事件</title>
    <link rel="stylesheet" href="/lib/layui/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lib/layui/layui/css/common.css">
    <script src="/lib/layui/layui/layui.js"></script>
    <script type="text/javascript" src="/lib/layui/layui/global.js"></script>
    <script type="text/javascript" src="../../js/jquery/jquery-1.9.1.js"></script>
    <script src="../../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/layui/layui/js/baseCode/base.js?v=201908121454" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/layui/layui/js/common.js?v=201907231346" type="text/javascript" charset="utf-8"></script>
    <style>
        .mbox{
            padding: 8px;
        }
        .layui-btn{
            margin-left: 10px;
        }
        .layui-form .one{
            width: 100%;
            display: flex;
            flex-flow: row wrap;
            justify-content: space-around;
        }
        .layui-form-item{
            width: 48%;
        }
        .layui-form-label{
            /*width:40px;*/
        }
        .layui-btn .layui-icon{
            margin-right: 0px;
        }
        .layui-form-label{
            padding: 8px 15px;
        }
        .layui-card-body{
            display: flex;
        }
        .layui-lf{
            min-width: 16%;
            overflow-x: auto;
            height: 600px !important;
        }
        .layui-rt{
            width: 84%;
            margin-left: 6px;
            margin-top: -11px;
        }
        .treeTitle{
            display: flex;
            box-sizing: border-box;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 30px;
            background-color: #00a0e9;
            color: #fff;
            padding: 15px;
            position: relative;
        }
        .rtfix{
            width:200px;
        }
        .bg{
            background-color: #F2F2F2;
        }
        .bgs{
            background-color: #F2F2F2;
        }
        .back{
            background-color: #ccc;
        }
        .eleTree{
            cursor: pointer;
        }
        .layui-table-view .layui-table td, .layui-table-view .layui-table th{
            padding: 3px 0;
        }
        .layui-tab-title{
            height: 30px;
        }
        .layui-tab-title li{
            height: 36px;
            margin-top: -5px;
        }
        .layui-tab layui-tab-card{
            margin-top: -4px;
        }
        .layui-tab-card>.layui-tab-title .layui-this:after {
            border-width: 0px;
        }
        .baseinfo td{
            padding: 5px 2px;
        }
        .active{
            display: none;
        }
        .back{
            background-color: #F2F2F2;
        }
        .layui-tab-title li{
            margin-top: 0;
        }
        .seeFild{
            padding:5px 10px 0 0;
        }
        .flex{
            display: flex;
        }
        .title {
            width:100%;
            height: 36px;
            line-height: 36px;
            background-color: #eeeeee;
            margin: 15px auto;
        }
        .title span{
            font-weight:bold;
            margin-left: 6px;
        }
        .one>div:nth-child(1){
            margin-right:4%;
        }
        .layui-form-label {
            width: 104px !important;
            padding: 9px 0px;
        }
        .Required{
            color:red;
        }
        .layui-card-body{
            padding:0 15px;
        }
        input[name='updateName'],input[name='updateTime']{
            cursor:not-allowed;
            background: #f1f1f5;
        }
        .search_field{
            margin-right:10px;
        }
        #SettlementDiv table,#brationrecord table{
            width:100%;
        }
        .Other_Explain{
            margin-bottom:20px;
        }
        .Other_Explain span{
            margin-left:36px;
        }
        .not-allowed{
            cursor: not-allowed;
            background: #f1f1f5;
        }
        .concluIntegrity>label,.concluRange>label,.concluResult>label{
            width: 186px
        }
        .Situation_Explain{
            height: 38px;
        }
        .Situation_Explain span{
            margin-left:36px;
        }
    </style>
</head>
<body>
<div class="mbox">
    <div class="layui-card">
        <div class="layui-card-body" style="padding-left: 6px;">
            <%--&lt;%&ndash;左侧选择设备的下拉数-%>--%>
            <div class="layui-lf rtfix">
                <div class="treeTitle" id="equip" dataType="0" >设备类别
                </div>
                <div class="panel-body">
                    <div class="eleTree ele1" lay-filter="data1"></div>
                </div>
            </div>
            <%--右侧的tab页--%>
            <div class="layui-rt" style="position: relative">
                <div class="layui-tab layui-tab-card" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title" style="height: 35px;">
                        <li class="layui-this">检定校准</li>
                        <li>期间核查</li>
                        <li>检定校准记录</li>
                        <li>期间核查记录</li>
                    </ul>
                    <input type="hidden" value="" id="equipEventType">
                    <%--很多选项--%>
                    <div class="layui-tab-content" style="padding: 2px 0" id="SettlementDiv">
                        <%--第一个tab--%>
                        <div class="layui-tab-item layui-show">
                            <table id="Settlement" lay-filter="SettlementFilter"></table>
                        </div>
                    </div>
                </div>

                <%--检定校准记录底部的内容--%>
                <form class="tabmain" lay-filter="Test1" style="display: none;">
                    <div class="techleft">
                        <div class="title"><span>技术指标</span></div>
                        <table class="layui-hide" id="brationrecord" lay-filter="Record"></table>
                    </div>

                    <div class="techleft layui-form">
                        <div class="title"><span>确认结论</span></div>
                        <div class="layui-form-item " style="width: 100%">
                            <label class="layui-form-label">确认结论：</label>
                            <div class="layui-input-block concluResult">
                                <input type="radio" disabled  name="concluResult" value="0" title="设备参数正常，运行良好">
                                <input type="radio" disabled  name="concluResult" value="1" title="设备参数异常，存在故障">
                            </div>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="concluUser" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input concluUser not-allowed">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="concluAddtime" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input concluAddtime not-allowed">
                                </div>
                            </div>
                        </div>
                        <div class="title"><span>审核意见</span></div>
                        <div class="layui-form-item " style="width: 100%">
                            <label class="layui-form-label">审核意见：</label>
                            <div class="layui-input-block auditmind">
                                <input type="radio" disabled  name="auditmind" value="0" title="设备参数正常，运行良好">
                                <input type="radio" disabled  name="auditmind" value="1" title="设备参数异常，存在故障">
                            </div>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">审核人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="approver" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input approver not-allowed">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">审核时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="approverTime" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input approverTime not-allowed">
                                </div>
                            </div>
                        </div>
                        <div class="title"><span>标识发放情况</span></div>
                        <div class="layui-form-item" style="width: 100%">
                            <label class="layui-form-label">标识分类：</label>
                            <div class="layui-input-block identType">
                                <input type="radio"disabled  name="identType" value="0" title="合格证">
                                <input type="radio"disabled  name="identType" value="1" title="准用证">
                                <input type="radio"disabled  name="identType" value="2" title="限用证">
                                <input type="radio"disabled  name="identType" value="3" title="停用证">
                            </div>
                        </div>
                        <p  class="Other_Explain"><span>其他情况说明：</span>状态标识领取人员在状态标识领取后，须在24小时内将标识粘贴在测量仪器设备规定的位置上</p>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">发放人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="grantUser" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input grantUser not-allowed">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">发放时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="grantTime" readonly="readonly" placeholder="请输入" autocomplete="off" class="layui-input grantTime not-allowed">
                                </div>
                            </div>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">领取人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="receiveUser" readonly="readonly" placeholder="请输入领取人员" autocomplete="off" class="layui-input receiveUser not-allowed">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">领取时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="receiveTime" readonly="readonly" placeholder="请输入领取时间" autocomplete="off" class="layui-input receiveTime not-allowed">
                                </div>
                            </div>
                        </div>
                    </div>
                </form>

                <%--期间核查记录底部的内容--%>
                <div class="qjmain" style="display: none;">
                    <%--技术指标--%>
                    <div class="techleft">
                        <div class="title"><span>技术指标</span></div>
                        <table class="layui-hide" id="brationrecord2" lay-filter="Record2"></table>
                    </div>
                    <div class="techleft layui-form">
                        <%--确认结论--%>
                        <div class="title"><span>确认结论</span></div>
                        <div class="layui-form-item " style="width: 100%">
                            <label class="layui-form-label">确认结论：</label>
                            <div class="layui-input-block confirm_conclusion">
                                <input type="radio"disabled  name="confirm_conclusion" value="0" title="设备参数正常，运行良好">
                                <input type="radio"disabled  name="confirm_conclusion" value="1" title="设备参数异常，存在故障">
                            </div>
                        </div>
                        <div class="layui-form-item " style="width: 100%">
                            <label class="layui-form-label" style="width: 270px !important;">测量仪器设备不符合检测试验要求时：
                            </label>
                            <div class="layui-input-block concluUsdesire">
                                <input type="radio"disabled  name="concluUsdesire" value="0" title="停用">
                                <input type="radio"disabled  name="concluUsdesire" value="1" title="限用">
                            </div>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="concluUser" placeholder="请输入确认人员" autocomplete="off" class="layui-input not-allowed concluUser">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">确认时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="concluAddtime" placeholder="请输入确认时间" autocomplete="off" class="layui-input not-allowed concluAddtime">
                                </div>
                            </div>
                        </div>

                        <%--审核意见--%>
                        <div class="title"><span>审核意见</span></div>
                        <div style="display: flex">
                            <div class="layui-form-item widths auditmind">
                                <label class="layui-form-label">审核意见：</label>
                                <div class="layui-input-block" style="display:flex">
                                    <input type="radio"disabled  name="Audit_opinion" value="0" title="同意">
                                    <input type="radio"disabled  name="Audit_opinion" value="1" title="不同意">
                                </div>
                            </div>
                        </div>
                        <div class="one" style="justify-content: flex-start;">
                            <div class="layui-form-item">
                                <label class="layui-form-label">审核人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="approver" placeholder="请输入审核人员" autocomplete="off" class="layui-input not-allowed approver">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">审核时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="approverTime" placeholder="请输入审核时间" autocomplete="off" class="layui-input not-allowed approverTime">
                                </div>
                            </div>
                        </div>

                        <%--标识发放情况--%>
                        <div class="title"><span>标识发放情况</span></div>
                        <div class="layui-form-item widths identType">
                            <label class="layui-form-label">标识分类：</label>
                            <div class="layui-input-block">
                                <input type="radio"disabled  name="Identification_classification" value="0" title="限用证">
                                <input type="radio"disabled  name="Identification_classification" value="1" title="停用证">
                            </div>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">发放人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="grantUser" placeholder="请输入发放人员" autocomplete="off" class="layui-input not-allowed grantUser">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">发放时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="grantTime" placeholder="请选择发放时间" autocomplete="off" class="layui-input not-allowed grantTime">
                                </div>
                            </div>
                        </div>
                        <div  class="Situation_Explain">
                            <span>其他情况说明： 状态标识领取人员在状态标识领取后，须在24小时内将标识粘贴在测量仪器设备规定的位置上。</span>
                        </div>
                        <div class="one">
                            <div class="layui-form-item">
                                <label class="layui-form-label">领取人员：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="receiveUser" placeholder="请输入领取人员" autocomplete="off" class="layui-input not-allowed receiveUser">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">领取时间：</label>
                                <div class="layui-input-block">
                                    <input type="text" name="receiveTime" placeholder="请选择领取时间" autocomplete="off" class="layui-input not-allowed receiveTime">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<%--编辑--%>
<div id="editor" style="display:none">
        <div class="title"><span>添加检定校准计划</span></div>
        <div class="layui-card-body">
            <form class="layui-form" lay-filter="formTest" action="" style="width: 100%;margin: 0 auto;">
                <input type="text" name="equipId" style="display: none" id="layui-form">
                <div class="one">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="Required">*</span>维护频率：</label>
                        <div class="layui-input-block">
                            <select name="frequency" lay-verify="required" class="frequency">
                                <option value=""></option>
                                <option value="1">每两年</option>
                                <option value="2">每年</option>
                                <option value="3">每月</option>
                                <option value="4">每季度</option>
                                <option value="5">每周</option>
                                <option value="6">每天</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">提前提醒天数：</label>
                        <div class="layui-input-block">
                            <input type="text" name="remindDays"  placeholder="请输入提前提醒天数" autocomplete="off" class="layui-input remindDays" oninput="value=value.replace(/[^\d]/g,'')">
                        </div>
                    </div>
                </div>
                <div class="one">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="Required">*</span>选择部门：</label>
                        <div class="layui-input-block">
                            <select name="deptId" lay-filter="deptIdNo" class="deptId">
                                <option value="">请选择</option>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="Required">*</span>上次执行时间：</label>
                        <div class="layui-input-block">
                            <input type="text" name="lastExeTime"  placeholder="请输入上次执行时间" autocomplete="off" class="layui-input lastExeTime">
                        </div>
                    </div>
                </div>
                <div class="one">
                    <div class="layui-form-item">
                        <label class="layui-form-label" style=""><span class="Required">*</span>送检形式：</label>
                        <div class="layui-input-block">
                            <input type="text" name="inspectform"  placeholder="请输入送检形式" lay-verify="required" autocomplete="off" class="layui-input inspectform">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">捡定/校准单位：</label>
                        <div class="layui-input-block">
                            <input type="text" name="company"  placeholder="请输入捡定/校准单位" autocomplete="off" class="layui-input company">
                        </div>
                    </div>
                </div>
                <div class="one">
                    <div class="layui-form-item">
                        <label class="layui-form-label" id="userId" name="">添加人：</label>
                        <div class="layui-input-block">
                            <input type="text" name="updateName" placeholder="请输入添加人" autocomplete="off" class="layui-input updateName" disabled="disabled">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">添加日期：</label>
                        <div class="layui-input-block">
                            <input type="text" name="updateTime" placeholder="请输入" autocomplete="off" class="layui-input updateTime" disabled="disabled">
                        </div>
                    </div>
                    <input type="hidden"  id="eventId" value="">
                </div>
            </form>
    </div>

    <div class="title"><span>设备信息</span></div>
    <div class="layui-card-body">
        <div class="tr_tds layui-table tabs" border="1" id="typeTab"></div>
    </div>

    <%--检定/校准参数及允许的最大误差--%>
    <div class="title"><span>检定/校准参数及允许的最大误差</span></div>
    <div class="layui-card-body" style="flex-direction:column">
        <div class="addtabs">
            <button data-type="0" id="addTableButton" class="layui-btn layui-btn-sm" lay-event="add" style="margin-left:0px;">添加</button>
        </div>
    </div>
    <div id="addTableDiv" class="layui-card-body">
        <table id="addTable" lay-filter="addTableFilter"></table>
    </div>
    <div class="layui-card-body">
        <table id="Settlement2" lay-filter="SettlementFilter2"></table>
    </div>
</div>
<script type="text/html" id="addTableDel">
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del2" name="">删除</a>
</script>

<%--批量编辑--%>
<div id="editors" style="display:none">
    <div class="title"><span>添加检定校准计划</span></div>
    <div class="layui-card-body">
        <form class="layui-form" lay-filter="formTest" action="" style="width: 100%;margin: 0 auto;">
            <input type="text" name="equipId" style="display: none">
            <div class="one">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="Required">*</span>维护频率：</label>
                    <div class="layui-input-block">
                        <select name="frequency" lay-verify="required" class="batch_frequency">
                            <option value=""></option>
                            <option value="1">每两年</option>
                            <option value="2">每年</option>
                            <option value="3">每月</option>
                            <option value="4">每季度</option>
                            <option value="5">每周</option>
                            <option value="6">每天</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">提前提醒天数：</label>
                    <div class="layui-input-block">
                        <input type="text" name="remindDays"  placeholder="请输入提前提醒天数" autocomplete="off" class="layui-input batch_remindDays" oninput="value=value.replace(/[^\d]/g,'')">
                    </div>
                </div>
            </div>
            <div class="one">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="Required">*</span>上次执行时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="lastExeTime"  placeholder="请输入上次执行时间" autocomplete="off" class="layui-input batch_lastExeTime">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="">送检形式：</label>
                    <div class="layui-input-block">
                        <input type="text" name="inspectform"  placeholder="请输入送检形式" lay-verify="required" autocomplete="off" class="layui-input batch_inspectform">
                    </div>
                </div>
            </div>
            <div class="one">
                <div class="layui-form-item">
                    <label class="layui-form-label">捡定/校准单位：</label>
                    <div class="layui-input-block">
                        <input type="text" name="company"  placeholder="请输入捡定/校准单位" autocomplete="off" class="layui-input batch_company">
                    </div>
                </div>
                <div class="layui-form-item">
                </div>
            </div>
        </form>
    </div>
</div>

<%--检定标准--%>
<script type="text/html" id="toolbar">
    <div class="demoTable indexOne" style="float: right; margin-right:9px;">
        <label  class="layui-form-label search_field">查询字段</label>
        <div class="layui-input-inline" style="height: 27px;margin-top: -11px;" >
            <select class="layui-select indexSeleOne columnName"  lay-filter="cloum" name="cloum" id="cloum" autocomplete="off">
                <option value="">请选择</option>
                <%--<option value="REPALOG_ID">记录编号</option>--%>
                <%--<option value="PROPERTY_NO">事件状态</option>--%>
                <option value="EQUIP_NAME">设备名称</option>
                <option value="EQUIP_NO">固定资产编号</option>
                <option value="company">所属部门</option>
                <option value="FACTORY_NO">出厂编号</option>
                <option value="MODEL_NO">型号</option>
                <%--<option value="FREQUENCY">维护频率</option>--%>
                <option value="LAST_EXE_TIME">上次执行日期</option>
                <option value="REMIND_DAYS">提前提醒天数</option>
                <option value="NEST_EXE_TIME">下次到期日期</option>
            </select>
        </div>
        <div class="layui-inline">
            <input class="layui-input inputValue" name="indexOne"autocomplete="off" style="height: 38px">
        </div>
        <button class="layui-btn search" data-type="reload" style="height:30px;line-height: 30px">搜索</button>
    </div>
    <%--校正标准--%>
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="add" id="addEq">新建</button>
        <button class="layui-btn layui-btn-sm" lay-event="batchedit">批量修改</button>
        <button class="layui-btn layui-btn-sm" lay-event="batch_delete">批量删除</button>
    </div>
</script>

<%--期间核查--%>
<script type="text/html" id="implement">
    <div class="demoTable indexOne" style="float: right; margin-right:9px;">
        <label  class="layui-form-label search_field">查询字段</label>
        <div class="layui-input-inline" style="height: 27px;margin-top: -11px;" >
            <select class="layui-select indexSeleOne columnName"  lay-filter="cloum" name="cloum"  autocomplete="off">
                <option placeholder="请选择"></option>
                <%--<option value="">记录编号</option>--%>
                <%--<option value="">事件状态</option>--%>
                <option value="EQUIP_NAME">设备名称</option>
                <option value="EQUIP_NO">固定资产编号</option>
                <option value="FACTORY_NO">出厂编号</option>
                <option value="MODEL_NO">型号</option>
                <%--<option value="FREQUENCY">维护频率</option>--%>
                <option value="LAST_EXE_TIME">上次执行日期</option>
                <option value="REMIND_DAYS">提前提醒天数</option>
                <option value="NEST_EXE_TIME">下次到期日期</option>
            </select>
        </div>
        <div class="layui-inline">
            <input class="layui-input inputValue" name="indexOne"  autocomplete="off" style="height: 38px">
        </div>
        <button class="layui-btn search" data-type="reload" style="height:30px;line-height: 30px">搜索</button>
    </div>
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="add">新建</button>
        <button class="layui-btn layui-btn-sm" lay-event="batchedit">批量修改</button>
        <button class="layui-btn layui-btn-sm" lay-event="batch_delete">批量删除</button>
    </div>
</script>

<%--检定校准记录--%>
<script type="text/html" id="vfmaintain">
    <div class="demoTable indexOne" style="float: right; margin-right:9px;margin-top: -1px;">
        <label  class="layui-form-label search_field">查询字段</label>
        <div class="layui-input-inline" style="height: 27px;margin-top: -11px;" >
            <select class="layui-select indexSeleOne columnName"  lay-filter="cloum" name="cloum"  autocomplete="off">
                <option placeholder="请选择"></option>
                <%--<option value="">记录编号</option>--%>
                <%--<option value="">事件状态</option>--%>
                <option value="EQUIP_NAME">设备名称</option>
                <option value="EQUIP_NO">固定资产编号</option>
                <option value="FACTORY_NO">出厂编号</option>
                <option value="MODEL_NO">型号</option>
                <%--<option value="FREQUENCY">维护频率</option>--%>
                <option value="LAST_EXE_TIME">上次执行日期</option>
                <option value="NEST_EXE_TIME">下次到期日期</option>
            </select>
        </div>
        <div class="layui-inline">
            <input class="layui-input inputValue" name="indexOne"  autocomplete="off" style="height: 38px">
        </div>
        <button class="layui-btn search" data-type="reload" style="height:30px;line-height: 30px">搜索</button>
    </div>
</script>

<%--期间核查记录--%>
<script type="text/html" id="record">
    <div class="demoTable indexOne" style="float: right; margin-right:9px;">
        <label  class="layui-form-label search_field">查询字段</label>
        <div class="layui-input-inline" style="height: 27px;margin-top: -11px;" >
            <select class="layui-select indexSeleOne columnName"  lay-filter="cloum" name="cloum"  autocomplete="off">
                <option placeholder="请选择"></option>
                <%--<option value="">记录编号</option>--%>
                <%--<option value="">事件状态</option>--%>
                <option value="EQUIP_NAME">设备名称</option>
                <option value="EQUIP_NO">固定资产编号</option>
                <option value="FACTORY_NO">出厂编号</option>
                <%--<option value="FREQUENCY">维护频率</option>--%>
                <option value="LAST_EXE_TIME">上次执行日期</option>
                <option value="NEST_EXE_TIME">下次到期日期</option>
            </select>
        </div>
        <div class="layui-inline">
            <input class="layui-input inputValue" name="indexOne"  autocomplete="off" style="height: 38px">
        </div>
        <button class="layui-btn search" data-type="reload" style="height:30px;line-height: 30px">搜索</button>
    </div>

</script>

<%--检定校准 表单内 右侧按钮--%>
<script type="text/html" id="barOperation">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-sm layui-btn-xs" lay-event="carried">执行</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" >删除</a>
</script>
<%--期间核查 表单内 右侧按钮--%>
<script type="text/html" id="maintain">
    <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-sm layui-btn-xs" lay-event="implement">执行</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del" >删除</a>
    <%--<a class="layui-btn layui-btn-xs" lay-event="zxwx">执行维修</a>--%>
    <%--<a class="layui-btn layui-btn-sm layui-btn-xs" lay-event="sub1">提交</a>--%>
</script>
<%--检定校准记录 表单内 右侧按钮--%>
<script type="text/html" id="Verification">
    <%--<a class="layui-btn layui-btn-xs" lay-event="weixyz">维修验证</a>--%>
    <%--<a class="layui-btn layui-btn-sm layui-btn-xs" lay-event="sub2">提交</a>--%>
</script>
<script type="text/javascript">
    var el
        ,aldata
        ,newstr='<div class="iptbox mnodec" pid="">'+
        '<input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="序号" class="layui-input pnul">'+
        '<input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="名称" class="layui-input shorts">'+
        '<input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="备注" class="layui-input longs">'+
        '<div class="btnls">'+
        '<button type="button" class="layui-btn layui-btn-primary layui-btn-sm limsAdd"><i class="layui-icon"></i></button>'+
        '<button type="button" class="layui-btn layui-btn-primary layui-btn-sm limsDel"><i class="layui-icon"></i></button>'+
        '</div>'+
        '</div>';
    var resultTypeData='';
    var a ="";
    var name;
    var pid;
    var idkey;
    var tableObj;
    var trObj;
    var equipIdes;   //下拉树的id
    var equipStatus=1;//设备维修状态
    var selectName;//下拉框的值
    var selectVal;//搜索框的值
    var addseleId;   //定义添加部门id
    var brationrecord;
    layui.use(['table','layer','form','element','eleTree','laydate'], function() {
        var table = layui.table;
        var laydate = layui.laydate;
        var layer = layui.layer;
        var form = layui.form;
        var eleTree = layui.eleTree;
        var element = layui.element;
        var $ = layui.jquery;
        var url = '/equipment/deleteEquipment';

        $("input[name=updateTime]").val(nowformat);  //添加日期默认当前时间

        //添加日期  呼出事件改成click
        $("input[name=updateTime]").each(function(){
            laydate.render({
                elem: this
                , trigger: 'click'
                , format: 'yyyy-MM-dd'
            });
        })

        laydate.render({
            elem: '.nestExeTime'
            , trigger: 'click'//呼出事件改成click
            , format: 'yyyy-MM-dd'
        });

        //上次执行时间 呼出事件改成click
        $("input[name=lastExeTime]").each(function(){
            laydate.render({
                elem:this,
                trigger: 'click',
                format: 'yyyy-MM-dd'
            })
        })

        //添加时间 呼出事件改成click
        $("input[name=dateTime]").each(function(){
            laydate.render({
                elem:this,
                trigger: 'click',
                format: 'yyyy-MM-dd'
            })
        })

        // 初始化渲染 树形菜单
        el = eleTree.render({
            elem: '.ele1',
            showLine: true,
            url: '/equipmentType/showParentEquipmentType',
            lazy: true,
            load: function (data, callback) {
                $.post('/equipmentType/showChildEquipmentType?equipTypeId=' + data.id, function (res) {
                    callback(res.data);//点击节点回调
                })

            },
            done: function (data) { //渲染完成回调
                aldata = data.data
                name = data.data[0].name //传的是默认选中的值
                pid = data.data[0].equipTypePid;
                getTabke(data.data[0].id);
                idkey = data.data[0].id;
                equipids = data.data[0].id;
                //给左侧的下拉数据点击时添加的背景颜色
                var dataid = $('.ele1 div').attr("data-id")
                $('.eleTree-node').removeClass('back')
                $('.ele1 div[data-id=' + dataid + ']').addClass('back')
                $('.eleTree-node-group').css('background', '#fff')
                var aa = $(".mbox").find(".ele1 .eleTree-node").eq(0).attr("data-id");
            }
        });

        // 节点点击事件
        eleTree.on("nodeClick(data1)", function (d) {
            var dataid = $('.ele1 div').attr("data-id")
            var a = d.data.currentData.id;
            $('.eleTree-node').removeClass('back')
            $(d.node[0]).addClass('back')
            $('.eleTree-node-group').css('background', '#fff')
            var obj = d.data.currentData
            name = obj.name
            pid = obj.equipTypePid;
            idkey = obj.id;
            $.post('/equipmentType/showEquipmentTypeById?equipTypeId=' + obj.id, function (res) {
                equipIdes = res.object.id    //节点点击下拉数的id
                var obj = res.data, str;
            })
            var currentPage = 1;
            $('.layui-this').click();
            // table.reload('Settlement', {
            //     url: '/LimsEquipEventsPlan/showAll?equipTypeId=' + obj.id,
            //     data: {page: currentPage},
            //     page: {
            //         curr: currentPage
            //     }
            // })
        });

        //监听select得id
        form.on('select(deptIdNo)', function(data){
            addseleId = data.value;
        });

        // 监听复选框事件
        table.on('checkbox(SettlementFilter)', function (obj) {
            var tr = obj.tr[0];
            if (obj.checked) {
                $(tr).addClass('bgs')
            } else {
                $(tr).removeClass('bgs').removeClass('bg')
            }
        });

        //监听表格行事件
        table.on('row(SettlementFilter)', function (obj) {
            var repalogId = obj.data.repalogId;
            var i = 0;
            a = obj.data.equipId;
            if (obj.data.dateProduc == undefined) {
                obj.data.dateProduc = nowformat();
            } else {
                obj.data.dateProduc = format(obj.data.dateProduc);
            }

            if (obj.data.recordDate == undefined) {
                obj.data.recordDate = nowformat();
            } else {
                obj.data.recordDate = format(obj.data.recordDate);
            }

            //选中行变颜色方法
            var index = $(this).attr('data-index');
            var tr = $(this).parent().children(tr);
            $(this).addClass("bg");
            for (var i = 0; i < tr.length; i++) {
                if (index != i) {
                    tr.eq(i).removeClass("bg");
                }
            }
            // console.log(obj.data) //获取选中行的数据


            var tab=$('.layui-this').text();
            if(tab=='检定校准记录'){
                Technical(obj.data)  //检定校准记录页面 调用
            }else if(tab=='期间核查记录'){
                Interim_record(obj.data)  //期间核查记录页面 调用
            }
            // var equipEventType=$('#equipEventType').val();
            // if(obj.data.eventLogId!=undefined&&equipEventType=='EQUIP_EVENT_TYPE1'){
            //     Technical(obj.data)
            // }
        });

        //顶部页签切换事件
        element.on('tab(docDemoTabBrief)', function (data) {
            var index = data.index;
            switch (index) {
                case 0:
                    tableReload('EQUIP_EVENT_TYPE1', "#barOperation", false, "#toolbar", "/LimsEquipEventsPlan/showAll");//检定校准
                    $('.tabmain').hide()
                    $('.qjmain').hide();
                    break;
                case 1:
                    tableReload('EQUIP_EVENT_TYPE2', "#maintain", false, "#implement", "/LimsEquipEventsPlan/showAll");//期间核查
                    $('.tabmain').hide()
                    $('.qjmain').hide();
                    break;
                case 2:
                    tableReload('EQUIP_EVENT_TYPE1', "", false, '#vfmaintain', "/LimsEquipEventlog/showAll");//检定校准记录
                    $('.tabmain').show();
                    $('.qjmain').hide();
                    break;
                case 3:
                    tableReload('EQUIP_EVENT_TYPE2', "", true, "#record", "/LimsEquipEventlog/showAll");//期间核查记录
                    $('.tabmain').hide();
                    $('.qjmain').show();
                    break;
            }

        });

        //监听头部工具栏事件
        table.on('toolbar(SettlementFilter)', function (res) {
            var checkStatus = table.checkStatus(res.config.id);
            switch (res.event) {
                case 'add'://检定校准 添加
                    if (pid == 0) {
                        layer.msg("一级类别下无法添加");
                        return false;
                    } else {
                        layer.open({
                            type: 2
                            , title: '添加'
                            , area: ['98%', '98%']
                            , maxmin: true
                            , content: '/LimsEquipEventsPlan/addEvent?addbtn=add'
                            , btn: ['保存', '取消']
                            , yes: function (index, layero) {
                                var experience = window["layui-layer-iframe" + index].getRepairDate();//获取  添加检定校准计划  子页面的变量
                                tableData=$(layero).find("iframe")[0].contentWindow.tableData;
                                var paraJson_data=tableData.cache["addTable"];//获取  检定/校准参数及允许的最大误差  子页面的变量
                                var json_data=tableData.cache["typeTab"];//获取  选中设备信息  子页面的变量

                                if(experience.frequency==""){//验证  维护频率 是否为空
                                    layer.msg('请选择维护频率', {icon: 2});
                                }else if(experience.deptId==""){//验证 选择部门  是否为空
                                    layer.msg('请选择部门', {icon: 2});
                                }else if(experience.lastExeTime==""){//验证 上次执行时间  是否为空
                                    layer.msg('请选择上次执行时间', {icon: 2});
                                }else if(experience.inspectform==""){//验证 送检形式  是否为空
                                    layer.msg('请填写送检形式', {icon: 2});
                                }else if(json_data.length==0){
                                    layer.msg('请选择设备信息', {icon: 2});
                                }else{
                                    //获取 选中设备信息 数据
                                    var json=new Array();
                                    for(var i = 0;i<json_data.length;i++){
                                        var json_obj={
                                            equipId:json_data[i].equipId,//设备id
                                            equipName:json_data[i].equipName,//设备名称
                                            // equipStatuasId:json_data[i].equipStatuasId,//设备状态
                                            equipStatusCode:json_data[i].equipStatusCode,//设备状态码
                                            equipNo:json_data[i].equipNo,//固定资产编号
                                            factoryNo:json_data[i].factoryNo,//出产编号
                                            modelNo:json_data[i].modelNo//型号
                                        }
                                        json.push(json_obj);
                                    }

                                    //获取 检定/校准参数及允许的最大误差 数据
                                    var paraJson=new Array();
                                    for(var i = 0;i<paraJson_data.length;i++){
                                        var paraJson_obj={
                                            paraName:paraJson_data[i].paraName,//参数名称
                                            initialValue:paraJson_data[i].initialValue,//测量点
                                            error:paraJson_data[i].error//允许的误差
                                        }
                                        paraJson.push(paraJson_obj);
                                    }

                                    $.ajax({
                                        url: "/LimsEquipEventsPlan/add",
                                        type: 'post',
                                        data:{
                                            frequency:experience.frequency,//维护频率
                                            remindDays:experience.remindDays,//提前提醒天数
                                            deptId:experience.deptId,//选择部门
                                            lastExeTime:experience.lastExeTime,//上次执行时间
                                            inspectform:experience.inspectform,//送检形式
                                            company:experience.company,//捡定/校准单位
                                            updateName:experience.updateName,//添加人
                                            updateTime:experience.updateTime,//添加日期
                                            updateUser:experience.userId,//添加人ID
                                            equipEventType:res.config.where.equipEventType,
                                            equipTypeId:idkey,
                                            json:JSON.stringify(json),
                                            paraJson:JSON.stringify(paraJson)
                                        },
                                        success:function (res){
                                            tableObj.reload();
                                            layer.msg(res.msg)
                                        }
                                    })
                                    layer.close(index);
                                }
                            }
                        });
                    }
                    break;
                case 'batch_delete'://检定校准  批量删除操作
                    // var checkStatus = table.checkStatus('Settlement'); //Settlement 即为基础参数 id 对应的值
                    var eventId='';//删除ID
                    if(checkStatus.data.length>0){
                        for(var i = 0;i<checkStatus.data.length;i++){
                            eventId+=checkStatus.data[i].eventId+',';//拼接 选中行的ids
                            publicDeleteEval('/LimsEquipEventsPlan/delete', eventId, tableObj, table);
                        }
                    }else{
                       layer.msg('请至少选择一条记录');
                    }
                    break;
                case 'qjadd'://期间核查 新增add
                    layer.open({
                        type: 2,
                        title:'新增期间核查记录',
                        area: ['98%', '98%'],
                        maxmin: true,
                        btn: ['确定', '取消'],
                        content:'/experience/fication'
                    })
                    break;
                case 'carried'://执行
                    layer.open({
                        type: 2,
                        title:'执行页面',
                        area: ['80%', '80%'],
                        maxmin: true,
                        btn: ['确定', '取消'],
                        content:'/experience/carriedOut',
                        success: function (layero, index) {

                        }
                    })
                    break;
                case 'batchedit'://检定校准 批量修改
                    var checkStatus = table.checkStatus('Settlement'); //Settlement 即为基础参数 id 对应的值
                    var ids='';//批量编辑
                    for(var i = 0;i<checkStatus.data.length;i++){
                        ids+=checkStatus.data[i].eventId+',';//拼接获取 选中行的id
                    }
                    if(checkStatus.data.length>0){
                        layer.open({
                            type: 1,
                            title: '批量修改',
                            area: ['98%', '60%'],
                            maxmin: true,
                            content: $('#editors'),
                            btn: ['保存', '取消'],
                            success: function(layero, index){//清空数据
                                $('.batch_frequency').attr('val','');//维护频率
                                $('.batch_remindDays').val('');//提前提醒天数
                                $('.batch_lastExeTime').val('');//上次执行时间
                                $('.batch_inspectform').val('');//送检形式
                                $('.batch_company').val('');//捡定/校准单位
                                form.render('select');
                            },
                            yes: function (index, layero) {
                                if($('.batch_frequency').val()==""){//验证  维护频率 是否为空
                                    layer.msg('请选择维护频率', {icon: 2});
                                    return
                                }else if($('.batch_lastExeTime').val()==""){//验证 上次执行时间  是否为空
                                    layer.msg('请选择上次执行时间', {icon: 2});
                                }else{
                                    $.ajax({
                                        url:'/LimsEquipEventsPlan/update',
                                        type: 'post',
                                        data:{
                                            ids:ids,//eventId
                                            frequency:$('.batch_frequency').val(),//维护频率
                                            remindDays:$('.batch_remindDays').val(),//提前提醒天数
                                            lastExeTime:$('.batch_lastExeTime').val(),//上次执行时间
                                            inspectform:$('.batch_inspectform').val(),//送检形式
                                            company:$('.batch_company').val(),//捡定/校准单位
                                        },
                                        success: function (res) {
                                            layer.msg(res.msg)
                                            tableObj.reload();
                                            setTimeout(function(){
                                                layer.close(index);
                                            }, 2000);
                                        }
                                    })
                                }
                            }
                        });
                    }else{
                        layer.msg('请至少选择一条记录');
                    }

                    $.ajax({// 选择当前部门和登录当前人的ajax
                        url: '/equipmentScrapping/showUserAndDept',
                        type: 'post',
                        dataType: 'json',
                        success: function (res) {
                            $select = $("select[name='deptId']")
                            var optionStr = ''
                            for (var i = 0; i < res.data[1].length; i++) {
                                var datass = res.data[1][i];
                                var deptName = datass.deptName;
                                deptIds = datass.deptId
                                optionStr += '<option  value="' + deptIds + '">' + deptName + '</option>'
                            }
                            $select.empty();
                            $select.append(optionStr)
                            $('.updateName').val(res.data[0].userName);//添加人name
                            $('.userId').attr('name',res.data[0].userId);//添加人ID
                            form.render('select');
                            $('.layui-unselect').val('请选择');//选择部门
                        }
                    })
                    break;
            }
        });

        //监听工具条 tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
        table.on('tool(SettlementFilter)', function (obj){
            var data = obj.data; //获得当前行数据
            trObj = data;
            var layEvent = obj.event; //获得 lay-event 对应的值（也可以是表头的 event 参数对应的值）
            if (layEvent === 'del') { //删除
                publicDeleteEval('/LimsEquipEventsPlan/delete', data.eventId, tableObj, table);
            }else if(layEvent === 'edit'){ //打开编辑页面
                layer.open({
                    type: 1,
                    title: '编辑',
                    area: ['98%', '98%'],
                    maxmin: true,
                    content: $('#editor'),
                    btn: ['保存', '取消'],
                    success: function(layero, index){
                        //选择部门下拉列表
                        $.ajax({
                            url: '/equipmentScrapping/showUserAndDept',
                            type: 'get',
                            async:false,
                            dataType: 'json',
                            success: function (res) {
                                $select = $("select[name='deptId']")
                                var optionStr = ''
                                for (var i = 0; i < res.data[1].length; i++) {
                                    var datass = res.data[1][i];
                                    var deptName = datass.deptName;
                                    deptIds = datass.deptId
                                    optionStr += '<option  value="' + deptIds + '">' + deptName + '</option>'
                                }
                                $select.empty();
                                $select.append(optionStr)
                                $('.updateName').val(res.data[0].userName);//添加人name
                                $('#userId').attr('name',res.data[0].userId);//添加人ID
                                form.render('select');
                            }
                        })

                        //基础信息和设备信息  数据回显
                        $.ajax({
                            url: '/LimsEquipEventsPlan/showDetils?id='+data.eventId,
                            type: 'get',
                            dataType: 'json',
                            success: function (res) {
                                var data=res.object;
                                $('.frequency').val(data.frequency);//维护频率
                                $('.remindDays').val(data.remindDays);//提前提醒天数
                                // $('.deptId').val(data.deptId);//选择部门
                                // 遍历select
                                $("select[name='deptId']").each(function() {
                                    // this代表的是<option></option>，对option再进行遍历
                                    $(this).children("option").each(function() {
                                        // 判断需要对那个选项进行回显
                                        if (this.value == data.deptId) {
                                            $(this).attr("selected","selected");// 进行回显
                                            form.render('select');
                                        }
                                    });
                                })
                                $('.lastExeTime').val(data.lastExeTime);//上次执行时间
                                $('.inspectform').val(data.inspectform);//送检形式
                                $('.company').val(data.company);//捡定/校准单位
                                $('.updateName').val(data.updateName);//添加人
                                $('.updateTime').val(data.updateTime);//添加日期
                                $('#eventId').val(data.eventId);//eventId
                                $('#userId').attr('name',data.updateUser)//添加人ID
                                table.render({//设备信息数据回显
                                    elem: '#typeTab'
                                    ,data:[data]
                                    ,cols: [[ //表头
                                        {field: 'equipName', title: '设备名称', fixed: 'left'}
                                        ,{field: 'equipStatusName', title: '设备状态'}
                                        ,{field: 'equipNo', title: '固定资产编号'}
                                        ,{field: 'factoryNo', title: '出产编号'}
                                        ,{field: 'modelNo', title: '型号'}
                                    ]]
                                });
                            }
                        })

                        //检定/校准参数及允许的最大误差 表格数据回显
                        $.ajax({
                            url: '/LimsEquipEventPlanPara/showByEventId?eventId='+data.eventId,
                            type: 'get',
                            success: function (res) {
                                table.render({
                                    elem: '#addTable'
                                    ,data:res.data
                                    ,cols: [[ //表头
                                        {field:'planParaId',title: 'ID',hide: true},
                                        {type: 'numbers', title: '序号',}
                                        , {field: 'paraName', title: '参数名称', edit:true}
                                        , {field: 'initialValue', title: '测量点', edit:true}
                                        , {field: 'error', title: '允许的误差',edit:true}
                                        , { width: 240, title: '操作', align: 'center', toolbar: '#addTableDel'}
                                    ]]
                                });
                            }
                        })
                    },
                    yes: function (index, layero) {
                        var paraJson_data=table.cache["addTable"];
                        var paraJson=new Array();
                        for(var i = 0;i<paraJson_data.length;i++){
                            var paraJson_obj={
                                paraName:paraJson_data[i].paraName,//参数名称
                                initialValue:paraJson_data[i].initialValue,//测量点
                                error:paraJson_data[i].error,//允许的误差
                                eventId:data.eventId,//eventId
                                planParaId:paraJson_data[i].planParaId//planParaId
                            }
                            paraJson.push(paraJson_obj);
                        }

                        var datas={
                            frequency:$('.frequency').val(),//维护频率
                            remindDays:$('.remindDays').val(),//提前提醒天数
                            deptId:$('.deptId').val(),//选择部门
                            lastExeTime:$('.lastExeTime').val(),//上次执行时间
                            inspectform:$('.inspectform').val(),//送检形式
                            company:$('.company').val(),//捡定/校准单位
                            updateName:$('.updateName').val(),//添加人
                            updateTime:$('.updateTime').val(),//添加日期
                            ids:$('#eventId').val(),//eventId
                            updateUser:$('#userId').attr('name'),//添加人ID
                            json:JSON.stringify(paraJson)
                        }
                        $.ajax({
                            url: '/LimsEquipEventsPlan/update?ids='+data.eventId,
                            type: 'post',
                            data:datas,
                            success: function (data) {
                                layer.msg(data.msg);
                                tableObj.reload()
                            },
                            error:function(err){
                                layer.msg(err.msg)
                            }
                        })
                        layer.close(index);
                    }
                });
            }else if(layEvent ==='carried'){
                json = JSON.stringify(data);
                var index =layer.open({
                    type: 2,
                    title:'检定校准执行',
                    area: ['98%', '98%'],
                    maxmin: true,
                    btn: ['保存', '取消'],
                    content:'/LimsEquipEventsPlan/carriedOut',
                    success:function(){
                        var iframe = window['layui-layer-iframe'+index];// 获取 执行页面的iframe
                        iframe.child(trObj);// 调用 子页面的全局函数child 并传参
                    },
                    yes:function(index, layero){
                        var getimplementDate=window["layui-layer-iframe" + index].getimplementDate();//获取  执行页面  子页面的变量
                        var tableData=$(layero).find("iframe")[0].contentWindow.tableData;
                        var json_data=tableData.cache["technical"];//获取 表格数据
                        var json=new Array();
                        for(var i = 0;i<json_data.length;i++){
                            var json_obj={
                                equipId:getimplementDate.equipId,//设备ID
                                paraName:json_data[i].paraName,//指标项目
                                uncertainty:json_data[i].uncertainty,//不确定度
                                error:json_data[i].error,//误差
                                initialValue:json_data[i].initialValue,//规定值
                                calibrationValue:json_data[i].calibrationValue,//检测/校准值
                                conclusion:json_data[i].conclusion//确认结论
                            }
                            json.push(json_obj);
                        }

                        if(getimplementDate.exeTime==''){
                            layer.msg('请选择检定/校准日期')
                            return
                        }else{
                            $.ajax({
                                url:'/LimsEquipEventlog/add',
                                type: 'post',
                                data:{
                                    eventId:getimplementDate.eventId,//选中行的id
                                    equipEventType:getimplementDate.equipEventType,//头部tab切换属性
                                    equipId:getimplementDate.equipId,//设备ID
                                    equipStatus:getimplementDate.equipStatus,//设备状态
                                    // eventStatus:getimplementDate.eventStatus,//事件状态
                                    // remindDays:getimplementDate.remindDays,//提前天数
                                    // lastExeTime:getimplementDate.lastExeTime,//上次执行日期
                                    // nestExeTime:getimplementDate.nestExeTime,//下次执行日期
                                    equipTypeId:getimplementDate.equipTypeId,//设备类型ID
                                    equipName:getimplementDate.equipName,//设备名称
                                    equipNo:getimplementDate.equipNo,//固定资产编号
                                    factoryNo:getimplementDate.factoryNo,//出厂编号
                                    modelNo:getimplementDate.modelNo,//型号
                                    deptId:getimplementDate.deptId,//所属部门
                                    exeTime:getimplementDate.exeTime,//检定/校准日期
                                    frequency:getimplementDate.frequency,//检定/校准周期
                                    company:getimplementDate.company,//检定/校准单位
                                    certNo:getimplementDate.certNo,//证书编号
                                    concluIntegrity:getimplementDate.concluIntegrity,//检定/校准项目完整性确认
                                    concluRange:getimplementDate.concluRange,//检定/校准项目测量范围确认
                                    concluResult:getimplementDate.concluResult,//确认结论
                                    concluUser:getimplementDate.concluUser,//确认人员
                                    concluAddtime:getimplementDate.concluAddtime,//确认时间
                                    auditmind:getimplementDate.auditmind,//审核意见
                                    approver:getimplementDate.approver,//审核人员
                                    approverTime:getimplementDate.approverTime,//审核时间
                                    identType:getimplementDate.identType,//标识分类
                                    grantUser:getimplementDate.grantUser,//发放人员
                                    grantTime:getimplementDate.grantTime,//发放时间
                                    receiveUser:getimplementDate.receiveUser,//领取人员
                                    receiveTime:getimplementDate.receiveTime,//领取时间
                                    json:JSON.stringify(json)
                                },
                                dataType: 'json',
                                success: function (res){
                                    tableObj.reload();
                                    layer.msg(res.msg)
                                },
                                error:function(err){
                                    layer.msg(err.msg)
                                }
                            });
                        }
                        layer.close(index);
                    }
                })
            }else if(layEvent ==='implement'){
                json = JSON.stringify(data);
                layer.open({
                    type: 2,
                    title:'期间核查执行',
                    area: ['98%', '98%'],
                    maxmin: true,
                    btn: ['确定', '取消'],
                    content:'/LimsEquipEventsPlan/implement',
                    success: function (layero, index){
                        var iframe = window['layui-layer-iframe'+index];// 获取 执行页面的iframe
                        iframe.implement_child(trObj);// 调用 子页面的全局函数child 并传参
                    },
                    yes:function(index, layero){
                        var getimplementDate=window["layui-layer-iframe" + index].getimplementDate();//获取  执行页面  子页面的变量
                        var tableData=$(layero).find("iframe")[0].contentWindow.tableData;
                        var json_data=tableData.cache["technical"];//获取 表格数据
                        var json=new Array();
                        for(var i = 0;i<json_data.length;i++){
                            var json_obj={
                                equipId:getimplementDate.equipId,//设备ID
                                paraName:json_data[i].paraName,//指标项目
                                uncertainty:json_data[i].uncertainty,//不确定度
                                error:json_data[i].error,//误差
                                initialValue:json_data[i].initialValue,//规定值
                                calibrationValue:json_data[i].calibrationValue,//检测/校准值
                                conclusion:json_data[i].conclusion//确认结论
                            }
                            json.push(json_obj);
                        }

                        if(getimplementDate.exeTime==''){
                            layer.msg('请选择核查日期')
                            return
                        }else{
                            $.ajax({
                                url:'/LimsEquipEventlog/add',
                                type: 'post',
                                data:{
                                    eventId:getimplementDate.eventId,//选中行的id
                                    equipEventType:'EQUIP_EVENT_TYPE2',//头部tab切换属性
                                    equipId:getimplementDate.equipId,//设备ID
                                    equipStatus:getimplementDate.equipStatus,//设备状态
                                    // eventStatus:getimplementDate.eventStatus,//事件状态
                                    // remindDays:getimplementDate.remindDays,//提前天数
                                    // lastExeTime:getimplementDate.lastExeTime,//上次执行日期
                                    // nestExeTime:getimplementDate.nestExeTime,//下次执行日期
                                    equipTypeId:getimplementDate.equipTypeId,//设备类型ID
                                    equipName:getimplementDate.equipName,//设备名称
                                    equipNo:getimplementDate.equipNo,//固定资产编号
                                    factoryNo:getimplementDate.factoryNo,//出厂编号
                                    modelNo:getimplementDate.modelNo,//型号
                                    deptId:getimplementDate.deptId,//所属部门
                                    exeTime:getimplementDate.exeTime,//核查日期
                                    usedEquip:getimplementDate.usedEquip,//使用设备
                                    frequency:getimplementDate.frequency,//检定/校准周期
                                    // concluIntegrity:getimplementDate.concluIntegrity,//检定/校准项目完整性确认
                                    // concluRange:getimplementDate.concluRange,//检定/校准项目测量范围确认
                                    concluResult:getimplementDate.concluResult,//确认结论
                                    concluUser:getimplementDate.concluUser,//确认人员
                                    concluAddtime:getimplementDate.concluAddtime,//确认时间
                                    auditmind:getimplementDate.auditmind,//审核意见
                                    approver:getimplementDate.approver,//审核人员
                                    approverTime:getimplementDate.approverTime,//审核时间
                                    identType:getimplementDate.identType,//标识分类
                                    grantUser:getimplementDate.grantUser,//发放人员
                                    grantTime:getimplementDate.grantTime,//发放时间
                                    receiveUser:getimplementDate.receiveUser,//领取人员
                                    receiveTime:getimplementDate.receiveTime,//领取时间
                                    concluUsdesire:getimplementDate.concluUsdesire,//当测量设备不符合检测实验要求
                                    json:JSON.stringify(json)
                                },
                                dataType: 'json',
                                success: function (res){
                                    tableObj.reload();
                                    layer.msg(res.msg)
                                },
                                error:function(err){
                                    layer.msg(err.msg)
                                }
                            });
                        }
                        layer.close(index);
                    }
                })
            }
        });

        //检定校准记录 技术指标 表格 初始化
        brationrecord=table.render({
            elem: '#brationrecord'
            ,data:[{}]
            ,page: {
                layout: ['prev', 'page', 'next',  'skip','count','limit',]
                ,limits:[5,10,15,20,25,30,35,40,45,50]
            }
            ,cols: [[
                {field:'paraName', title:'能力项',width:'20%'}
                ,{field:'uncertainty', title:'不确定度',width:'20%'}
                ,{field:'error', title:'误差',width:'10%'}
                ,{field:'initialValue', title:'规定值（出厂能力值）',width:'20%'}
                ,{field:'calibrationValue', title:'检测/校准值（检测能力值）',width:'20%'}
                ,{field:'conclusion', title:'确认结论',width:'10%',templet: function(data){
                        if(data.conclusion=='1'){
                            return '符合'
                        }else{
                            return '不符合'
                        }
                }}
            ]]
            ,limit:5
        });

        //检定校准记录form 数据回显
        function Technical(obj){
            //技术指标 表格
            brationrecord.reload({
                url:'/LimsEquipEventsCapy/showByEventLogId?eventLogId='+obj.eventLogId,
                done: function(res, curr, count){
                    var aa=table.cache["brationrecord"];//获取 表格数据
                }
            });

            obj.concluIntegrity=='0'?$(".Completeness input[value='0']").prop('checked',true):$(".Completeness input[value='1']").prop('checked',true);//检定/校准项目完整性确认 回显
            obj.concluRange=='0'?$(".concluRange input[value='0']").prop('checked',true):$(".concluRange input[value='1']").prop('checked',true);//检定/校准项目测量范围确认 回显
            if(obj.concluResult=='0'){//确认结论 回显
                $(".concluResult input[value='0']").prop('checked',true);
            }else if(obj.concluResult=='1'){
                $(".concluResult input[value='1']").prop('checked',true);
            }else{
                $(".concluResult input[value='2']").prop('checked',true);
            }

            if(obj.auditmind=='0'){//审核意见 回显
                $(".auditmind input[value='0']").prop('checked',true);
            }else if(obj.auditmind=='1'){
                $(".auditmind input[value='1']").prop('checked',true);
            }else{
                $(".auditmind input[value='2']").prop('checked',true);
            }

            if(obj.identType=='0'){//标识分类 回显
                $(".identType input[value='0']").prop('checked',true);
            }else if(obj.identType=='1'){
                $(".identType input[value='1']").prop('checked',true);
            }else if(obj.identType=='2'){
                $(".identType input[value='2']").prop('checked',true);
            }else{
                $(".identType input[value='3']").prop('checked',true);
            }
            $('.concluUser').val(obj.concluUser);//确认人员 回显
            $('.concluAddtime').val(obj.concluAddtime);//确认时间 回显
            $('.approver').val(obj.approver);//审核人员 回显
            $('.approverTime').val(obj.approverTime);//审核时间 回显
            $('.grantUser').val(obj.grantUser);//发放人员 回显
            $('.grantTime').val(obj.grantTime);//发放时间 回显
            $('.receiveUser').val(obj.receiveUser);//领取人员 回显
            $('.receiveTime').val(obj.receiveTime);//领取时间 回显
            form.render('radio'); //更新全部
        }

        //期间核查记录 技术指标 表格 初始化
        var brationrecord2=table.render({
            elem: '#brationrecord2'
            ,data:[{}]
            ,page: {
                layout: ['prev', 'page', 'next',  'skip','count','limit',]
                ,limits:[5,10,15,20,25,30,35,40,45,50]
            }
            ,cols: [[
                {field:'paraName', title:'能力项',width:'20%'}
                ,{field:'uncertainty', title:'不确定度',width:'20%'}
                ,{field:'error', title:'误差',width:'10%'}
                ,{field:'initialValue', title:'规定值（出厂能力值）',width:'20%'}
                ,{field:'calibrationValue', title:'检测/校准值（检测能力值）',width:'20%'}
                ,{field:'conclusion', title:'确认结论',width:'10%',templet: function(data){
                        if(data.conclusion=='1'){
                            return '符合'
                        }else{
                            return '不符合'
                        }
                    }}
            ]]
            ,limit:5
        });

        //期间核查记录form 数据回显
        function Interim_record(obj){
            //技术指标 表格
            brationrecord2.reload({
                url:'/LimsEquipEventsCapy/showByEventLogId?eventLogId='+obj.eventLogId,
                done: function(res, curr, count){
                    // var aa=table.cache["brationrecord"];//获取 表格数据
                }
            });

            obj.concluResult=='0'?$(".confirm_conclusion input[value='0']").prop('checked',true):$(".confirm_conclusion input[value='1']").prop('checked',true);//确认结论 回显

            obj.concluUsdesire=='0'?$(".concluUsdesire input[value='0']").prop('checked',true):$(".concluUsdesire input[value='1']").prop('checked',true);//测量仪器设备不符合检测试验要求时 回显

            obj.auditmind=='0'?$(".auditmind input[value='0']").prop('checked',true):$(".auditmind input[value='1']").prop('checked',true);//审核意见 回显
            obj.identType=='0'?$(".identType input[value='0']").prop('checked',true):$(".identType input[value='1']").prop('checked',true);//标识分类 回显

            $('.concluUser').val(obj.concluUser);//确认人员 回显
            $('.concluAddtime').val(obj.concluAddtime);//确认时间 回显
            $('.approver').val(obj.approver);//审核人员 回显
            $('.approverTime').val(obj.approverTime);//审核时间 回显
            $('.grantUser').val(obj.grantUser);//发放人员 回显
            $('.grantTime').val(obj.grantTime);//发放时间 回显
            $('.receiveUser').val(obj.receiveUser);//领取人员 回显
            $('.receiveTime').val(obj.receiveTime);//领取时间 回显
            form.render(); //更新全部
        }

        // 添加按钮点击事件
        $("#addTableButton").click(function () {
            var type=$(this).attr("data-type");
            if(type=="0"&&table.cache["addTable"].length=="0"){
                //代表还未点击过添加
                data=[];//置空，默认一个
                table.reload('addTable',{
                    data : data
                });
                var $addTable=$("#addTableDiv");//得到第二个实例
                $addTable.css("display","block");
                $(this).attr("data-type","1");
                $("#addTableButton").click();
            }else{
                data =  table.cache["addTable"];
                var data1={                  //特殊初始赋值
                    paraName :"",
                    initialValue:"",
                    error:""
                };
                data.push(data1);
                table.reload('addTable',{
                    data : data
                });
            }
        });

        //删除 检定/校准参数及允许的最大误差行
        table.on('tool(addTableFilter)',function (obj) {
            var layEvent = obj.event; //获得 lay-event 对应的值
            var datatr = obj.data;//获取行数据
            var tr = obj.tr;
            var me=$(this);
            $.ajax({
                url:'/LimsEquipEventPlanPara/deleteByIds',
                type:'post',
                data:{
                    ids:datatr.planParaId
                },
                success:function(data){
                    layer.msg('删除成功')
                },
                error:function(err){
                    layer.msg('删除失败')
                }
            })

            if(layEvent=='del2'){
                var index=tr.attr("data-index");
                obj.del(tr);
                data =  table.cache["addTable"];
                data.splice(parseInt(index),1);
                table.reload('addTable',{
                    data : data
                });
                var trs=$("#addTableDiv").find(".layui-table-body").find("tr");
                if(trs.length==0){//代表最后一个已经被删除
                    closeTable();
                }
            }
        });

        //列表搜索功能
        $(document).on('click', '.search', function () {
            var columnName=$('.columnName').val();
            var inputValue=$('.inputValue').val();
            // var a = []
            // displayData(a);

            if(columnName==''){
                layer.msg('请选择查询字段')
            }else if(inputValue==''){
                layer.msg('搜索关键字不能为空')
            }else{
                tableObj.reload({
                    url: '/LimsEquipEventsPlan/showAll',
                    page: true
                    , where: {
                        columnName:columnName,
                        inputValue: inputValue,
                        equipTypeId:idkey
                    }, done: function (res) {
                        layer.msg(res.msg)
                        displayData(res);
                        $("#SettlementDiv tbody").find("tr").eq(0).click();
                    }
                })
                $('.columnName').val(columnName);
                $('.inputValue').val(inputValue);

                // tableObj.reload({
                //     url: '/equipment/selectByEquipReparlogt',
                //     page: true,
                //     where: {
                //         repairStatus: equipStatus,
                //         FieldName: columnName,
                //         FieldValue: inputValue
                //     }
                //     , done: function (res) {
                //         $("input[name='indexOne']").val(selectVal);  //输入框
                //         $(".indexSeleOne").each(function () {
                //             // this代表的是<option></option>，对option再进行遍历
                //             $(this).children("option").each(function () {
                //                 // 判断需要对那个选项进行回显
                //                 if (this.value == selectName) {
                //                     // 进行回显
                //                     $(this).attr("selected", "selected");
                //                 }
                //             });
                //         });
                //         form.render('select');
                //         $("#SettlementDiv tbody").find("tr").eq(0).click();
                //     }
                // })
            }
        })

        //回车实现搜索  下面方法兼容谷歌，火狐，ie:
        document.onkeydown = function (e) {
            var theEvent = window.event || e;
            var code = theEvent.keyCode || theEvent.which;
            if (code == 13) {
                $('.search').click();
            }
        };

        //关闭方法
        function closeTable() {
            $("#addTableButton").attr("data-type","0");
            var $addTable=$("#addTableDiv");//得到第二个实例
            $addTable.css("display","none");
            $("#saveTbleButton").css("display","none");
        }
    })

    //节点点击初始化调用方法
    function getTabke(getid,colbtn) {
        tableObj=layui.table.render({
            elem: '#Settlement'
            ,url: '/LimsEquipEventsPlan/showAll?equipTypeId='+getid //数据接口
            ,where:{"equipEventType":'EQUIP_EVENT_TYPE1'}
            ,page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                layout: ['prev', 'page', 'next',  'skip','count','limit',]//自定义分页布局
                ,limits:[5,10,15,20,25,30,35,40,45,50]
                ,first: false //不显示首页
                ,last: false //不显示尾页
            } //开启分页
            ,toolbar:'#toolbar'
            ,cols: [[ //表头
                {type: 'checkbox' }
                ,{field: 'eventId', title: '编号',width:'7%',sort:true}
                ,{field: 'eventStatus', title: '状态',width:'7%',sort:true}
                ,{field: 'equipName', title: '设备名称',width:'10%',sort:true}
                ,{field: 'equipNo', title: '固定资产编号',sort:true}
                ,{field: 'deptName', title: '所属部门'}
                ,{field: 'factoryNo', title: '出厂编号'}
                ,{field: 'modelNo', title: '型号'}
                ,{field: 'frequency', title: '维护频率',align:'center',templet:function(data){
                        if(data.frequency=='1'){
                            return '每两年'
                        }else if(data.frequency=='2'){
                            return '每年'
                        }else if(data.frequency=='3'){
                            return '每月'
                        }else if(data.frequency=='4'){
                            return '每季度'
                        }else if(data.frequency=='5'){
                            return '每周'
                        }else if(data.frequency=='6'){
                            return '每天'
                        }
                    }}
                ,{field: 'lastExeTime', title: '上次执行日期',width:'11%'}
                // ,{field: 'remindDays', title: '提前提醒天数'}
                ,{field: 'nestExeTime', title: '下次到期日期',width:'11%'}
                ,{field: 'operations',title:'操作',align:'center',toolbar:'#barOperation',width:175}
                // ,{field: 'workflowNo', title: '流水号',hide:true}
                // ,{field: 'userName', title: '添加人',hide:true}
            ]]
            ,limit:5
            ,done:function(res) {
                if (res.data != undefined && res.data.length > 0) {
                    //displayData(res.data[0]);
                    $("#SettlementDiv tbody").find("tr").eq(0).click();
                    $.get('/equipmentCapys/selectByEquipId',{equipId:res.data[0].equipId},function (res) {
                        resultTypeData = res.data;
                        var str="";
                        for(var i=0;i<resultTypeData.length;i++){
                            str += '<tr>' +
                                '<td style="color: #111;">'+resultTypeData[i].capyName+'</td>' +
                                '<td idx="'+i+'" typename="capyInitialValue" class="edit" style="color: #111;">'+undefind_nullStr(resultTypeData[i].capyInitialValue)+'</td>' +
                                '<td idx="'+i+'" typename="calibrationValue"  class="edit" style="color: #111;">'+undefind_nullStr(resultTypeData[i].calibrationValue)+'</td>' +
                                '</tr>';
                        }
                        $(".total").html(str)
                        layui.form.render();
                    })
                } else {
                    var a = {}
                    displayData(a);
                }
            }
        });
    };

    //表格重新加载函数
    function tableReload(param,clos,bool,toolbar,url){
        $('#equipEventType').val(param);//向选择设备页面传值
        var last_time='',nest_time='',eventId='';
        if(clos!=''){
            last_time='lastExeTime';
            nest_time='nestExeTime';
            eventId='eventId';

            var cols=[[ //检定校准和期间核查 表头
                {type: 'checkbox' }
                ,{field: eventId, title: '编号',width:'7%',sort:true}
                ,{field: 'eventStatus', title: '状态',width:'7%',sort:true}
                ,{field: 'equipName', title: '设备名称',width:'10%',sort:true}
                ,{field: 'equipNo', title: '固定资产编号',sort:true}
                ,{field: 'deptName', title: '所属部门'}
                ,{field: 'factoryNo', title: '出厂编号'}
                ,{field: 'modelNo', title: '型号'}
                ,{field: 'frequency', title: '维护频率',align:'center',templet:function(data){
                        if(data.frequency=='1'){
                            return '每两年'
                        }else if(data.frequency=='2'){
                            return '每年'
                        }else if(data.frequency=='3'){
                            return '每月'
                        }else if(data.frequency=='4'){
                            return '每季度'
                        }else if(data.frequency=='5'){
                            return '每周'
                        }else if(data.frequency=='6'){
                            return '每天'
                        }
                    }}
                ,{field: last_time, title: '上次执行日期',width:'11%'}
                ,{field: nest_time, title: '下次到期日期',width:'11%'}
                ,{field: 'operations',title: '操作',align:'center', toolbar:clos,width:175}
            ]]
        }else{
            last_time='exeTime';
            nest_time='expireDate';
            eventId='eventLogId';

            var cols=[[ //检定校准记录和期间核查记录 表头
                {field: eventId, title: '编号',width:'7%',sort:true}
                ,{field: 'equipName', title: '设备名称',sort:true}
                ,{field: 'equipNo', title: '固定资产编号',sort:true}
                ,{field: 'factoryNo', title: '出厂编号'}
                ,{field: 'modelNo', title: '型号'}
                ,{field: last_time, title: '上次执行日期',width:'11%'}
                ,{field: nest_time, title: '下次到期日期',width:'11%'}
                ,{field: 'workflowNo', title: '流水号'}
            ]]
        }

        tableObj=layui.table.render({
            elem: '#Settlement',
            where: {
                "equipEventType":param,
                "equipTypeId":idkey
            },
            page: {
                curr: 1 //重新从第 1 页开始
            },
            url: url,
            toolbar: toolbar,
            cols:cols,
            done: function (res) {
                // if(clos==''){
                //     $("[data-field='operations']").remove()//删除操作列
                //     $("[data-field=0]").remove()//删除复选框列
                //     $("[data-field='eventStatus']").remove()//删除事件状态列
                //     $("[data-field='remindDays']").remove()//删除提前提醒天数
                //     $("[data-field='frequency']").remove()//删除维护频率
                //
                //     // var td_width=$('#SettlementDiv th').width();//动态设置记录页面 表格列宽
                //     // $('#SettlementDiv .layui-table-cell').css('width',td_width+'px');
                // }else{
                //     $("[data-field='workflowNo']").remove()//删除流水号列
                //     // $("[data-field='userName']").remove()//删除添加人列
                // }
                //
                // if(toolbar=='#record'){
                //     $("[data-field='modelNo']").remove()//删除型号列
                // }
                //
                // if(toolbar!='#toolbar'){
                //     $("[data-field='company']").remove()//删除所属部门列
                // }

                if(toolbar=='#vfmaintain'){
                    $("[lay-id='Settlement'] td").css('cursor','pointer')//鼠标经过行点击样式
                }

                if (res.data != undefined && res.data.length > 0) {
                    //display(res.data[0]);
                    $("#SettlementDiv tbody").find("tr").eq(0).click();
                } else {
                    var dataInfo = {}
                    displayData(dataInfo);
                }
            }
        })
    }

    //左侧 刷新设备类别
    $("#equip").click(function () {
        window.location.reload()
    })

    // 给指定表格  隐藏操作栏
    function settingClos1(table, operationId) {
        var operation = {fixed: 'right', hide: true, width: 250, title: '操作', align: 'center', toolbar: operationId}
        var tableArray = table;
        if (tableArray != undefined && tableArray != "") {
            tableArray[0].push(operation);
        }
        return tableArray;
    }

    //给指定表格  添加操作栏属性
    function settingClos(table, operationId) {
        var operation = {
            fixed: 'right',
            hide: false,
            width: 250,
            title: '操作',
            align: 'center',
            toolbar: operationId
        }
        var tableArray = table;
        if (tableArray != undefined && tableArray != "") {
            tableArray[0].push(operation);
        }
        return tableArray;
    }

    $('#fixed').click(function (e) {
        e.stopPropagation();
        $('table').width('100%')
        if ($(this).attr('dataType') != 1) {
            $('.layui-lf').fadeOut();
            $('.layui-rt').animate({width: '100%'});
            $(this).attr('dataType', '1');
        } else {
            $('.layui-lf').fadeIn();
            $('.layui-rt').animate({width: '84%'});
            $(this).attr('dataType', '0');
        }

    })

    function undefind_nullStr(value) {
        if(value==undefined){
            return ""
        }
        return value
    }

    function displayData(data){
        if(data==undefined || data=='undefined'||data.length<1||data.repalogId==undefined||data.repalogId==''){

            $('.none').html('');
            $(".total").addClass("active");
        }else{
            $('#equipNo').html(data.repalogId);
            $('#equipName').html(data.equipName);
            $('#equipStatuasId').html(undefind_nullStr(data.faultType));
            $('#equipTypeName').html((data.equipTypeName));
            $('#modelNo').html(data.modelNo);
            $('#faultPosition').html(data.faultPosition);
            $('#applicant').html(data.applicant);
            $('#workflowNo').html(data.workflowNo);
            //$('#positionId').html(data.positionId);
            $('#factoryNo').html(data.factoryNo);
            $('#propertyNo').html(undefind_nullStr(data.propertyNo));
            $('#deptName').html(data.deptName);
            $('#atmosphereTemp').html(data.atmosphereTemp)
            $('#atmosphereHumi').html(data.atmosphereHumi)
            $('#voltage').html(data.voltage)
            $('#resistance').html(data.resistance)
            $('#waterPressure').html(data.waterPressure)
            $('#pressure').html(data.pressure)
            $("#atmospherePress").html(data.atmospherePress)
            $('#faultType').html(data.faultType)
            $('#faultPosition').html(data.faultPosition)
            $('#applicationTime').html(data.applicationTime)
            $('#faultDesc').html(data.faultDesc)
            $('#attachmentName').html(data.attachmentName);
            $('#attachmentName').attr("data-id",data.attachmentId);
            $(".total").removeClass("active");
            $('#equipNo').html(undefind_nullStr(data.equipNo));
            $('#equipTypeName').html(undefind_nullStr(data.equipTypeName));
            $('#equipName').html(undefind_nullStr(data.equipName));
            // $('#equipStatuasId').html(undefind_nullStr(data.equipStatuasId));
            $('#equipTypeId').html(undefind_nullStr(data.equipTypeId));
            $('#modelNo').html(undefind_nullStr(data.modelNo));
            $('#spec').html(undefind_nullStr(data.spec));
            if(data.repairStatus==1){
                $('#equipStatuasCode').html(undefind_nullStr('报修中'))
            }else if(data.repairStatus==2){
                $('#equipStatuasCode').html(undefind_nullStr('维修中'))
            }else if(data.repairStatus==3){
                $('#equipStatuasCode').html(undefind_nullStr('验证中'))
            }else if(data.repairStatus==0){
                $('#equipStatuasCode').html(undefind_nullStr('已完成'))
            }


            $('#manufacturer').html(undefind_nullStr(data.manufacturer));
            $('#supplier').html(undefind_nullStr(data.supplier));
            //$('#positionId').html(undefind_nullStr(data.positionId));
            $('#factoryNo').html(undefind_nullStr(data.factoryNo));
            $('#borrowerdeptName').html(undefind_nullStr(data.deptName));
            $('#waterTemp').html(undefind_nullStr(data.waterTemp))
            $('#dateProduc').html(undefind_nullStr(format(data.dateProduc)));
            $('#recordDate').html(undefind_nullStr(format(data.recordDate)));
            $('#sourceAssets').html(undefind_nullStr(data.sourceAssets));
            $('#assetsCost').html(undefind_nullStr(data.assetsCost));
            // $('#propertyId').html(undefind_nullStr(data.propertyId));
            $('#accountFile').html(undefind_nullStr(data.accountFile));
            $('#sensitivityX').html(undefind_nullStr(data.sensitivityX));
            $('#sensitivityY').html(undefind_nullStr(data.sensitivityY));
            $('#sensitivityZ').html(undefind_nullStr(data.sensitivityZ));
            $('#phyQuantiId').html(undefind_nullStr(data.phyQuantiId));
            $('#directionId').html(undefind_nullStr(data.directionId));
            $('#couplingId').html(undefind_nullStr(data.couplingId));
            $('#cloudSn').html(undefind_nullStr(data.cloudSn));
            $('#custodian').html(undefind_nullStr(data.custodian));
            $('#standMateYn').html(undefind_nullStr(data.standMateYn));
            $('#technicalParm').html(undefind_nullStr(data.technicalParm));
            $('#memo').html(undefind_nullStr(data.memo));
            $('#deptId').html(undefind_nullStr(data.deptId));
            $('#deptName').html(undefind_nullStr(data.deptName));
            $('#attachmentName').html(data.attachmentName);
            $('#attachmentName').attr("data-id",data.attachmentId);
            //维修结果
            $('.inResult').val(undefind_nullStr(data.inResult));
            $('.outResult').val(undefind_nullStr(data.outResult));
            $('.inFaultPosition').val(undefind_nullStr(data.inFaultPosition));
            $('.outFaultPosition').val(undefind_nullStr(data.outFaultPosition));
            $('.inReason').val(undefind_nullStr(data.inReason));
            $('.outReason').val(undefind_nullStr(data.outReason));
            $('#inRepairMeasure').val(undefind_nullStr(data.inRepairMeasure));
            $('.outRepairMeasure').val(undefind_nullStr(data.outRepairMeasure));
            $('#outinR').val(undefind_nullStr(data.outinR));
            $(".grade").val(undefind_nullStr(data.grade));
            $('.outRepairRank').val(undefind_nullStr(data.outRepairRank));
            $('.inRepairRank').val(undefind_nullStr(data.inRepairRank));
            $(".inPrice").val(undefind_nullStr(data.inPrice));
            $('.outPrice').val(undefind_nullStr(data.outPrice));
            $('.inRepairMode').val(undefind_nullStr(data.inRepairMode));
            $('.outRepairMode').val(undefind_nullStr(data.outRepairMode));
            //验证结果
            $(".verifyMeasure").html(undefind_nullStr(data.verifyMeasure))
            $(".equipVerifyMode").html(undefind_nullStr(data.equipVerifyMode))
            $(".equipRepairResult").html(undefind_nullStr(data.equipRepairResult))
            $(".reportDoneTime").html(undefind_nullStr(data.reportDoneTime))
            $(".verifyUser").html(undefind_nullStr(data.verifyUser))
            $(".inPlanTime").val(undefind_nullStr(data.inPlanTime))
            $(".outPlanTime").val(undefind_nullStr(data.outPlanTime))
            $(".inPerson").val(undefind_nullStr(data.inPerson))
            $(".outPerson").val(undefind_nullStr(data.outPerson))
        }

    }

    //刪除页数最后一条数据自动返回上一页
    function publicDeleteEval(url,ids,tableIns,table){
        layer.confirm('确定要删除吗?', {icon: 3, title:'提示'}, function(index){
            var data={
                ids:ids
            }
            var res=toAjaxT(url,data);
            layer.msg(res.msg);

            if(res.code==0){
                try {
                    if (ids.substring(ids.length - 1) == ","){
                        ids = ids.substring(0, ids.length - 1);
                    }
                    var dataSize = ids.split(",");
                    var dataAll = table.cache[tableIns.config.id];
                    if (dataAll.length == dataSize.length) {
                        //得到当前页
                        var page = $(".layui-laypage-skip .layui-input").val();

                        if (page > 1) {
                            tableIns.reload({
                                page: {
                                    curr: page - 1 //重新从第 1 页开始
                                }}
                            );
                        }else{
                            tableIns=tableIns.reload();
                        }
                    } else {
                        tableIns=tableIns.reload();
                    }
                } catch (e) {
                    tableIns.reload();
                }
            }
            layer.close(index);
        });
    }

    //同步ajax
    function toAjaxT(url,data) {
        var result;
        $.ajax({
            url:url,
            data:data,
            type: 'post',
            async:false,
            dataType: 'json',
            success: function (res){
                result=res;
            }
        });
        return result;
    }

    //子调父关闭弹框方法
    function close() {
        tableObj.reload()
        layer.closeAll();
    }
    function closeend(){
        layer.closeAll();
    }

    //将毫秒数转为yyyy-MM-dd格式时间
    function format(t) {
        var str = "";
        var nnow = new Date(t);
        var year = nnow.getFullYear();
        var month = nnow.getMonth() + 1;
        var day = nnow.getDate();
        str = year + "-" + month + "-" + day;
        return str;
    }

    //获取当前时间  年月日
    function nowformat() {
        var nstr = "";
        var now = new Date();
        var nyear = now.getFullYear();
        var nmonth = now.getMonth() + 1;
        var nday = now.getDate();
        if (nmonth < 10) {
            nmonth = "0" + nmonth;
        }
        if (nday < 10) {
            nday = "0" + nday;
        }
        nstr = nyear + "-" + nmonth + "-" + nday;
        return nstr;
    }
</script>
</body>
</html>